package com.cheng.io.decorator;

/**
 * 日志装饰者
 */
public class CloseableLogDecorator extends CloseableDecorator{
    private final Closeable closeable;

    public CloseableLogDecorator(Closeable closeable) {
        super(closeable);
        this.closeable = closeable;
    }

    @Override
    public void close() {
        System.out.println(closeable.getClass().getSimpleName() + "-开始执行");
        super.close();
        System.out.println(closeable.getClass().getSimpleName() + "-执行结束");
    }
}
